package com.apci.ipreda.security.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.ServletRequestDataBinder;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

public class LoginController extends SimpleFormController {
		
		public LoginController() {
			/*setCommandName("searchFlights");
			setCommandClass(SearchFlights.class);
			setFormView("beginSearch");
			setSuccessView("listFlights");*/
		}
		
		protected void initBinder(HttpServletRequest req,ServletRequestDataBinder binder) throws Exception {
//			binder.registerCustomEditor(Date.class, new CustomDateEditor(
//					new SimpleDateFormat("yyyy-MM-dd HH"), true));
		}
		
		protected ModelAndView onSubmit(Object command) throws Exception {
			//SearchFlights search = (SearchFlights) command;
			ModelAndView mav = new ModelAndView(getSuccessView());
			logger.info("onSubmit");
			//LoginForm loginForm = (LoginForm)command;
		
			//mav.addObject("flights", flights.findFlights(search));
			//mav.addObject("searchFlights", search);
			return mav;
		}
}
